package com.kerwin.menumgt.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.kerwin.menumgt.MenuService;
import com.kerwin.menumgt.entity.Menu;
import com.kerwin.menumgt.mapper.MenuMapper;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import java.util.TreeMap;

@Service
public class MenuServiceImpl extends ServiceImpl<MenuMapper, Menu> implements MenuService {

    /*获取前端添加菜单左面的所有权限*/
public Map<String,String> menuDetails(){

    LambdaQueryWrapper<Menu> menuLambdaQueryWrapper = new LambdaQueryWrapper<>();

    List<Menu> menus = baseMapper.selectList(menuLambdaQueryWrapper);

    TreeMap<String, String> menuHash = new TreeMap<>();

    menus.forEach(i->
            menuHash.put(i.getId(),i.getMenuName())
    );
    return menuHash;
}

public void getPermDetail(){
    /*先把父菜单查出来*/
    LambdaQueryWrapper<Menu> menuQueryWrapper = new LambdaQueryWrapper<Menu>();
    List<Menu> menus = baseMapper.selectList(menuQueryWrapper);




}




}
